package com.chrelyonly.controllermvc;

import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author chrelyonly
 * mvc模式
 */
@RestController
@RequestMapping("/index")
public class ControllerMvc {
    @RequestMapping("/index")
    public ModelAndView index(ModelMap modelMap, String msg) {
        modelMap.addAttribute("msg", msg);
        return new ModelAndView("hello");
    }
}
